package cpm.project;

import jdk.swing.interop.SwingInterOpUtils;

public class MyTest {
    public static void main(String[] args) {
        Wife wife = new Wife();
        wife.kill(new Cat());
        wife.kill(new PastPan());

    }
}

class Wife{
    public void kill(IKillMouse m){
        m.killMouse();
    }
}

interface IKillMouse{
    void killMouse();
}

class Cat implements IKillMouse{

    @Override
    public void killMouse() {
        System.out.println("吃了它");
    }
}

class PastPan implements IKillMouse{

    @Override
    public void killMouse() {
        System.out.println("粘死它");
    }
}
